package com.bytecollege.service.Impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.bytecollege.mapper.CtypeMapper;
import com.bytecollege.model.Ctype;
import com.bytecollege.service.CtypeService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @ClassName: CtypeServiceImpl
 * @Description:
 * @Author: Sun
 * @Date: 2022/10/18 21:03
 */
@Service
public class CtypeServiceImpl extends ServiceImpl<CtypeMapper,Ctype> implements CtypeService {
    @Autowired
    public CtypeMapper ctypeMapper;

    public List<Ctype> getCtype(){
        return ctypeMapper.selectList(null);
    }

    public Ctype getByName(String ctypeName){
        return ctypeMapper.selectOne(new QueryWrapper<Ctype>().eq("ctype_name",ctypeName));
    }
}